import request from '@/utils/request'

//医院设置-相关接口
const API = "/admin/hosp/hospitalSet";

export default {
  //分页条件查询
  getPageList(page, size, searchObj) {
    return request({
      url: `${API}/getPageList/${page}/${size}`,
      method: 'get',
      params: searchObj //params传递的参数(?k1=v1&k2=v2)  data传递的参数 {k1:v1, k2:v2}
    })
  },
  //根据id删除
  removeById(id) {
    return request({
      url: `${API}/${id}`,
      method: 'delete'
    })
  },
  //添加
  add(hospitalSet) {
    return request({
      url: `${API}/add`,
      method: 'post',
      data: hospitalSet
    })
  },
  //根据id查询
  getById(id) {
    return request({
      url: `${API}/${id}`,
      method: 'get'
    })
  },
  //修改
  update(hospitalSet) {
    return request({
      url: `${API}/update`,
      method: 'put',
      data: hospitalSet
    })
  },
  //锁定与解锁
  updateStatus(id, status){
    return request({
      url: `${API}/updateStatus/${id}/${status}`,
      method: 'put',
    })
  },
  //批量删除
  batchRemove(idList){
    return request({
      url: `${API}/batchRemove`,
      method: 'delete',
      data: idList
    })
  }
}